/**
 * 上报数据
 * @author rxliuli
 */
Vue.component('rx-report-data', {
    props: {
        add: String,
        update: String,
        del: String,
        row: null,
    },
    methods: {
        insertReport() {
            this.$emit('add', this.row)
        },
        updateReport() {
            this.$emit('update', this.row)
        },
    },
    computed: {
        reportShow() {
            return this.row.reportStatus === 0 || this.row.reportStatus === 3
        },
    },
    template: `<span>

  <el-button
    type="primary"
    size="mini"
    v-if="reportShow && row.dataFeature === 1"
    @click.stop.prevent="insertReport"
    v-realm="add"
  >新增上报</el-button>
  <el-button
    type="primary"
    size="mini"
    v-if="reportShow && row.dataFeature === 2"
    @click.stop.prevent="updateReport"
    v-realm="update"
  >修改上报</el-button>
  <el-button
    type="primary"
    size="mini"
    v-if="reportShow && row.dataFeature === 3"
    @click.stop.prevent="updateReport"
    v-realm="del"
  >删除上报</el-button>
</span>
    `,
})